public class Lab01 {

	public static void func1()
	{
		System.out.println("Welcome to Java, Welcome to Computer Science, and Programming is fun.");
	}
	public static void func2()
	{
        System.out.println("Welcome to Java");
		System.out.println("Welcome to Java");
		System.out.println("Welcome to Java");
		System.out.println("Welcome to Java");
		System.out.println("Welcome to Java");
	}
	public static void func3()
	{
		System.out.println("   J    A    V     V    A   ");
		System.out.println("   J   A A    V   V    A A  ");
		System.out.println("J  J  AAAAA    V V    AAAAA ");
		System.out.println(" JJ  A     A    V    A     A");
	}
	public static void func4()
	{
		System.out.println("a    a^2  a^3");
		System.out.println("1    1    1");
		System.out.println("2    4    8");
		System.out.println("3    9    27");
		System.out.println("4    16   64");
	}

	public static void func5()
	{
		double r = (9.5*4.5-2.5*3)/(45.5-3.5);
		System.out.println(r);
	}
	private static double pai (int n)
	{
				double f=1.0,p=0;
				int i;
			for(i=1;i<=n;i=i+1)
			{
				p=p+4*f*1.0/(2*i-1);
				f=f*(-1);
			}
		return p;
	}
	public static void func6()
	{
		double p;
		p=pai(6);
		System.out.println(p);
		p=pai(7);
		System.out.println(p);
	}
	public static void func7()
	{
		double r = 5.5,p,a;
		p = 2*r*Math.PI;
		a=r*r*Math.PI;
		System.out.println("perimeter = "+p);
		System.out.println("area = "+a);
		
	}
	public static void func8()
	{
		double area,w=4.5,h=7.9;
		area = w*h;
		System.out.println("area="+area);
	}
	public static void func9()
	{
		double k,t,m,am;
		t=45.5/60;
		k=14;
		m=k/1.6;
		am=m/t;
		System.out.println("the average speed in miles per hour is"+am);
	}
	public static void func10()
	{
		int population=312032486;
		int y=365,s;
		s=y*24*3600*5;
		int bir,dea,imm;
		bir=s/7;
		dea=s/13;
		imm=s/45;
		population =population+bir-dea+imm;
		System.out.println("population is" + population);
	}
	public static void main(String[] args) {
		func1();
		func2();
		func3();
		func4();
		func5();
		func6();
		func7();
		func8();
		func9();
		func10();

	}

}
